package co.yixiang.modules.adopt.service;

import co.yixiang.common.service.BaseService;
import co.yixiang.modules.adopt.entity.domain.YxAdoptCategory;
import co.yixiang.modules.adopt.entity.dto.YxAdoptCategoryDto;
import co.yixiang.modules.adopt.entity.dto.YxAdoptCategoryQueryCriteria;
import co.yixiang.modules.adopt.entity.vo.YxAdoptCategoryVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface YxAdoptCategoryService extends BaseService<YxAdoptCategory> {

    /**
     * 查询数据分页
     * @return Map<String, Object>
     */
    List<YxAdoptCategoryVo> queryAllByVo();


    //================================= 后台 ===================================================

    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String, Object>
     */
    Map<String, Object> queryAll(YxAdoptCategoryQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     * @param criteria 条件参数
     * @return List<YxStoreCategoryDto>
     */
    List<YxAdoptCategoryDto> queryAll(YxAdoptCategoryQueryCriteria criteria);

    /**
     * 导出数据
     * @param all 待导出的数据
     * @param response /
     * @throws IOException /
     */
    void download(List<YxAdoptCategoryDto> all, HttpServletResponse response) throws IOException;

    Object buildTree(List<YxAdoptCategoryDto> categoryDTOList);


    boolean checkCategory(int pid);

    boolean checkProductCategory(int id);
}
